﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// ThongKeTaiSan Repository. Good example of CRUD operations.
    ///// </summary>
    public class ThongKeTaiSanRepository : IThongKeTaiSanRepository
    {
        private static readonly IThongKeTaiSanDao _thongKeTaiSan = DataAccess.ThongKeTaiSanDao;
        public List<ThongKeTaiSan> GetList()
        {
            return _thongKeTaiSan.GetThongKeTaiSan().ToList();
        }

        public ThongKeTaiSan Get(string id)
        {
            return _thongKeTaiSan.GetThongKeTaiSanByID(id);
        }

        public void Insert(ThongKeTaiSan t)
        {
            _thongKeTaiSan.InsertThongKeTaiSan(t);
        }

        public void Update(ThongKeTaiSan t)
        {
            _thongKeTaiSan.UpdateThongKeTaiSan(t);
        }

        public void Delete(ThongKeTaiSan t)
        {
            _thongKeTaiSan.DeleteThongKeTaiSan(t);
        }

        public List<ThongKeTaiSan> GetThongKeTaiSanBySchoolId(int schoolId)
        {
           return _thongKeTaiSan.GetThongKeTaiSanBySchoolId(schoolId);
        }
    }
}